<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h3>Es6新标准案例</h3>
		
		
			<script>
				var x = 10;
				var y = 20;
				
				console.log(x+y);
				
				var x = 100;
				console.log(x);	//覆盖前面的值
				
				var x = "abc";
				console.log(x);
				
				let j = 86;		//不覆盖
				console.log(j);
				{
					let j = 100;
					console.log(j);
				}
				console.log(j);
				
				const PI = 3.1415926;//常量
				console.log(PI);
				
				let js = function(){
					console.log("无参函数");
				}
				js();
				
				var js1 = function(arg){
					return arg;
				}
				var s = "有参js1";
				console.log(js1(s));
				
				var es = () =>{
					console.log("es箭头无参函数");
				}
				es();
				
				var esone = () => console.log("superme")
				esone();
				
				
				var es1 = arg =>arg;
				console.log(es1("es1 有参"));
				
				
				var es1 = arg =>{ return arg;}
				console.log(es1("es1 有参"));
				
				
				var js2 = function(a,b){
					return a+b;
				}
				console.log(js2(2,5));
				
				var es2 = (a,b) => a+b;
				console.log(es2(3,8));
				
				
				
				
			</script>
	</body>
</html>

